package com.lgy.springcloud.service.impl;

import com.lgy.springcloud.entity.Payment;
import com.lgy.springcloud.mapper.PaymentMapper;
import com.lgy.springcloud.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("paymentService")
public class PaymentServiceImpl implements PaymentService {
    @Autowired
    PaymentMapper paymentMapper;
    @Override
    public int deleteById(Long id) {
        return paymentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int save(Payment payment) {
        return paymentMapper.insert(payment);
    }

    @Override
    public int saveSelective(Payment payment) {
        return paymentMapper.insertSelective(payment);
    }

    @Override
    public Payment findById(Long id) {
        return paymentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByIdSelective(Payment payment) {
        return paymentMapper.updateByPrimaryKeySelective(payment);
    }

    @Override
    public int updateById(Payment payment) {
        return paymentMapper.updateByPrimaryKey(payment);
    }

    @Override
    public List<Payment> findAll() {
        return paymentMapper.selectAll();
    }
}
